// 考试模块所有请求

import request from '@/utils/request'
// 获取学科信息
export function getTreeList() {
  return request({
    url: '/subject/tree',
    method: 'get'
  })
}
// 获取试卷信息
export function getPaperList(params) {
  return request({
    url: 'exam/paper',
    method: 'get',
    params
  })
}
// 切换状态信息
export function changePaperStatus(id, state) {
  return request({
    url: `exam/paper/${id}/${state}`,
    method: 'get'
  })
}
// 添加试卷信息
export function addPaper(data) {
  return request({
    url: 'exam/paper',
    method: 'post',
    data
  })
}
// 修改试卷信息
export function editPaper(data) {
  return request({
    url: `exam/paper/${data.id}`,
    method: 'put',
    data
  })
}
// 获取题目信息
export function getquestions(params) {
  return request({
    url: 'exam/question',
    method: 'get',
    params
  })
}
// 删除试卷信息
export function deletePaper(id) {
  return request({
    url: `exam/paper/${id}`,
    method: 'DELETE'
  })
}
// 获取考试信息
export function getExamList(params) {
  return request({
    url: 'exam/exam',
    method: 'get',
    params
  })
}
// 添加试卷信息
export function addExam(data) {
  return request({
    url: 'exam/exam',
    method: 'post',
    data
  })
}
// 删除考试信息
export function deleteExam(id) {
  return request({
    url: `exam/exam/${id}`,
    method: 'DELETE'
  })
}
